home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / x / volume12 / acm / part07 < prev    next >
Encoding:
Internet Message Format  |  1991-03-01  |  46.3 KB

  1. From: riley@mipsdal.mips.com (Riley Rainey)
  2. Newsgroups: comp.sources.x
  3. Subject: v12i012: acm - X aerial combat simulation, Part07/09
  4. Message-ID: <8989@exodus.Eng.Sun.COM>
  5. Date: 2 Mar 91 08:32:47 GMT
  6. Approved: argv@sun.com
  7.  
  8. Submitted-by: riley@mipsdal.mips.com (Riley Rainey)
  9. Posting-number: Volume 12, Issue 12
  10. Archive-name: acm/part07
  11.  
  12. #! /bin/sh
  13. # This is a shell archive.  Remove anything before this line, then unpack
  14. # it by saving it into a file and typing "sh file".  To overwrite existing
  15. # files, type "sh file -c".  You can also feed this as standard input via
  16. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  17. # will see the following message at the end:
  18. #        "End of archive 7 (of 9)."
  19. # Contents:  acm/Makefile acm/V/Makefile acm/fsim/m61a1.c
  20. # Wrapped by riley@mipsdal on Thu Feb 14 10:09:20 1991
  21. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  22. if test -f 'acm/Makefile' -a "${1}" != "-c" ; then 
  23.   echo shar: Will not clobber existing file \"'acm/Makefile'\"
  24. else
  25. echo shar: Extracting \"'acm/Makefile'\" \(14158 characters\)
  26. sed "s/^X//" >'acm/Makefile' <<'END_OF_FILE'
  27. X# Makefile generated by imake - do not edit!
  28. X# $XConsortium: imake.c,v 1.51 89/12/12 12:37:30 jim Exp $
  29. X
  30. X###########################################################################
  31. X# Makefile generated from "Imake.tmpl" and <Imakefile>
  32. X# $XConsortium: Imake.tmpl,v 1.77 89/12/18 17:01:37 jim Exp $
  33. X#
  34. X# Platform-specific parameters may be set in the appropriate .cf
  35. X# configuration files.  Site-wide parameters may be set in the file
  36. X# site.def.  Full rebuilds are recommended if any parameters are changed.
  37. X#
  38. X# If your C preprocessor doesn't define any unique symbols, you'll need
  39. X# to set BOOTSTRAPCFLAGS when rebuilding imake (usually when doing
  40. X# "make Makefile", "make Makefiles", or "make World").
  41. X#
  42. X# If you absolutely can't get imake to work, you'll need to set the
  43. X# variables at the top of each Makefile as well as the dependencies at the
  44. X# bottom (makedepend will do this automatically).
  45. X#
  46. X
  47. X###########################################################################
  48. X# platform-specific configuration parameters - edit Mips.cf to change
  49. X
  50. X# platform:  $XConsortium: Mips.cf,v 1.2 89/01/11 14:58:19 jim Exp $
  51. X# operating system:             RISCOS
  52. X
  53. X         SYSVTYPE = -systype sysv
  54. X          BSDTYPE = -systype bsd43
  55. X         SYSVDEFS = -DMips -DSYSV
  56. X          BSDDEFS = -DMips -DBSD43
  57. X         SYSVINCS = -I$(DESTDIR)/usr/include/bsd
  58. X          BSDINCS =
  59. X         SYSVLIBS = -lbsd -lmld
  60. X          BSDLIBS = -lmld
  61. X
  62. X          SYSTYPE = $(BSDTYPE)
  63. X          SYSDEFS = $(BSDDEFS)
  64. X          SYSINCS = $(BSDINCS)
  65. X          SYSLIBS = $(BSDLIBS)
  66. X
  67. X     OPTIM = -O -Olimit 2000 -Wf,-XNd8400,-XNp12000
  68. X     CCOPT = -signed
  69. X   DEFINES = -D_NO_PROTO
  70. XSYSVCFLAGS = $(OPTIM) $(CCOPT) $(SYSVTYPE) $(INCLUDES) $(SYSVDEFS) $(SYSVINCS) $(DEFINES)
  71. X BSDCFLAGS = $(OPTIM) $(CCOPT) $(BSDTYPE)  $(INCLUDES) $(BSDDEFS)  $(BSDINCS)  $(DEFINES)
  72. X
  73. X           ETCDIR = /etc
  74. X          ULIBDIR = /usr/lib
  75. X
  76. X      XINSTALLDIR = RISCwindows4.0
  77. X     INSTALLFLAGS = -m 0555
  78. X        RS1210DIR = $(DESTDIR)/usr/$(XINSTALLDIR)/RS1210
  79. X    CONTRIBBINDIR = $(DESTDIR)/usr/$(XINSTALLDIR)/contrib/bin
  80. XCONTRIBAPPSDEFDIR = $(DESTDIR)/usr/$(XINSTALLDIR)/contrib/lib/app-defaults
  81. X    CONTRIBMANDIR = $(DESTDIR)/usr/$(XINSTALLDIR)/contrib/man
  82. X    CONTRIBSRCDIR = $(DESTDIR)/usr/$(XINSTALLDIR)/contrib/src
  83. X     RS1210LIBDIR = $(LIBDIR)/ncd
  84. X
  85. X          BINPATH = /usr/bin/X11
  86. X          LIBPATH = /usr/lib/X11
  87. X          ETCPATH = /usr/etc/X11
  88. X          ADMPATH = /usr/adm
  89. X          NCDPATH = /usr/X11/ncd
  90. X       NCDLIBPATH = $(LIBPATH)/ncd
  91. X        XINITPATH = $(LIBPATH)/xinit
  92. X          XDMPATH = $(ETCPATH)/xdm
  93. X          UWMPATH = $(LIBPATH)/uwm
  94. X          AWMPATH = $(LIBPATH)/awm
  95. X          MWMPATH = $(LIBPATH)/mwm
  96. X          TWMPATH = $(LIBPATH)/twm
  97. X     XAPPLOADPATH = $(LIBPATH)/app-defaults
  98. X        RS1210SRC = $(TOP)/rs1210
  99. X
  100. X       MOTIFSRC = $(TOP)/motif
  101. X        MLIBSRC = $(MOTIFSRC)/lib
  102. X     MCLIENTSRC = $(MOTIFSRC)/clients
  103. X       MDEMOSRC = $(MOTIFSRC)/demos
  104. X    MTOOLKITSRC = $(MOTIFSRC)/X11R4/lib/Xt
  105. X     MWIDGETSRC = $(MLIBSRC)/Xm
  106. X   INCLUDEXMSRC = $(MLIBSRC)/Xm
  107. X   MRESOURCESRC = $(MLIBSRC)/Mrm
  108. X         MWMDIR = $(LIBDIR)/Mwm
  109. X     DEMOBINDIR = $(DESTDIR)/usr/$(XINSTALLDIR)/demos/bin
  110. X     DEMOSRCDIR = $(DESTDIR)/usr/$(XINSTALLDIR)/demos/src
  111. X       MINCLUDE = $(TOP)/include
  112. X         UILSRC = $(MCLIENTSRC)/uil
  113. X            UIL = $(UILSRC)/uil
  114. X
  115. X      XMTOOLLIB = $(MTOOLKITSRC)/libXt.a
  116. X          XMLIB = $(MWIDGETSRC)/libXm.a
  117. X   MRESOURCELIB = $(MRESOURCESRC)/libMrm.a
  118. X         UILLIB = $(UILSRC)/libUil.a
  119. X
  120. X  BUILDTOOLSDIR = $(TOP)/buildtools
  121. XCROSSENVOVERRIDE= DESTROOT=/ COMP_TARGET_ROOT=/ ETCDIR=/etc ULIBDIR=/usr/lib
  122. X
  123. X###########################################################################
  124. X# site-specific configuration parameters - edit site.def to change
  125. X
  126. X# site:  $XConsortium: site.def,v 1.21 89/12/06 11:46:50 jim Exp $
  127. X
  128. X            SHELL =     /bin/sh
  129. X
  130. X              TOP = .
  131. X      CURRENT_DIR = .
  132. X
  133. X               AR = ar clr
  134. X  BOOTSTRAPCFLAGS = $(SYSDEFS)
  135. X               CC = cc
  136. X
  137. X         COMPRESS = compress
  138. X              CPP = /lib/cpp $(STD_CPP_DEFINES)
  139. X    PREPROCESSCMD = cc -E $(STD_CPP_DEFINES)
  140. X          INSTALL = $(ETCDIR)/mipsinstall
  141. X               LD = ld
  142. X             LINT = lint
  143. X      LINTLIBFLAG = -C
  144. X         LINTOPTS = -axz
  145. X               LN = ln -s
  146. X             MAKE = make ETCDIR='$(ETCDIR)' ULIBDIR='$(ULIBDIR)'
  147. X               MV = mv
  148. X               CP = cp
  149. X           RANLIB = /bin/true
  150. X  RANLIBINSTFLAGS =
  151. X               RM = rm -f
  152. X     STD_INCLUDES =
  153. X  STD_CPP_DEFINES = $(SYSDEFS)
  154. X      STD_DEFINES = $(SYSDEFS) $(SYSINCS)
  155. X EXTRA_LOAD_FLAGS =
  156. X  EXTRA_LIBRARIES = $(SYSLIBS)
  157. X             TAGS = ctags
  158. X
  159. X   SIGNAL_DEFINES = -DSIGNALRETURNSINT
  160. X
  161. X    PROTO_DEFINES =
  162. X
  163. X     INSTPGMFLAGS =
  164. X
  165. X     INSTBINFLAGS = -m 0755
  166. X     INSTUIDFLAGS = -m 4755
  167. X     INSTLIBFLAGS = -m 0664
  168. X     INSTINCFLAGS = -m 0444
  169. X     INSTMANFLAGS = -m 0444
  170. X     INSTDATFLAGS = -m 0444
  171. X    INSTKMEMFLAGS = -g sys -m 2755
  172. X
  173. X          DESTDIR = $(DESTROOT)
  174. X
  175. X     TOP_INCLUDES = -I$(INCROOT)
  176. X
  177. X      CDEBUGFLAGS = $(OPTIM) $(CCOPT) $(SYSTYPE)
  178. X        CCOPTIONS =
  179. X      COMPATFLAGS =
  180. X
  181. X      ALLINCLUDES = $(STD_INCLUDES) $(TOP_INCLUDES) $(INCLUDES) $(EXTRA_INCLUDES)
  182. X       ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(PROTO_DEFINES) $(DEFINES) $(COMPATFLAGS) $(EXT_DEFINES)
  183. X           CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(ALLDEFINES)
  184. X        LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES)
  185. X           LDLIBS = $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
  186. X        LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS)
  187. X   LDCOMBINEFLAGS = -X -r
  188. X
  189. X        MACROFILE = Mips.cf
  190. X           RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut *.u *.b
  191. X
  192. X    IMAKE_DEFINES =
  193. X
  194. X         IRULESRC = $(CONFIGDIR)
  195. X        IMAKE_CMD = $(IMAKE) -DUseInstalled -I$(IRULESRC) $(IMAKE_DEFINES)
  196. X
  197. X     ICONFIGFILES = $(IRULESRC)/Imake.tmpl $(IRULESRC)/Imake.rules \
  198. X            $(IRULESRC)/Project.tmpl $(IRULESRC)/site.def \
  199. X            $(IRULESRC)/$(MACROFILE) $(EXTRA_ICONFIGFILES)
  200. X
  201. X###########################################################################
  202. X# X Window System Build Parameters
  203. X# $XConsortium: Project.tmpl,v 1.63 89/12/18 16:46:44 jim Exp $
  204. X
  205. X###########################################################################
  206. X# X Window System make variables; this need to be coordinated with rules
  207. X# $XConsortium: Project.tmpl,v 1.63 89/12/18 16:46:44 jim Exp $
  208. X
  209. X          PATHSEP = /
  210. X        USRLIBDIR = $(DESTDIR)/usr/$(XINSTALLDIR)/lib
  211. X           BINDIR = $(DESTDIR)/usr/$(XINSTALLDIR)/bin
  212. X          INCROOT = $(DESTDIR)/usr/$(XINSTALLDIR)/include
  213. X     BUILDINCROOT = $(TOP)
  214. X      BUILDINCDIR = $(BUILDINCROOT)/X11
  215. X      BUILDINCTOP = ..
  216. X           INCDIR = $(INCROOT)/X11
  217. X           ADMDIR = $(DESTDIR)/usr/adm
  218. X           LIBDIR = $(USRLIBDIR)/X11
  219. X        CONFIGDIR = $(LIBDIR)/config
  220. X       LINTLIBDIR = $(USRLIBDIR)/lint
  221. X
  222. X          FONTDIR = $(LIBDIR)/fonts
  223. X         XINITDIR = $(LIBDIR)/xinit
  224. X           XDMDIR = $(DESTDIR)/usr/X11/etc/xdm
  225. X           AWMDIR = $(LIBDIR)/awm
  226. X           TWMDIR = $(LIBDIR)/twm
  227. X           GWMDIR = $(LIBDIR)/gwm
  228. X          MANPATH = $(DESTDIR)/usr/$(XINSTALLDIR)/man/cat
  229. X    MANSOURCEPATH = $(MANPATH)/man
  230. X           MANDIR = $(MANSOURCEPATH)1
  231. X        LIBMANDIR = $(MANSOURCEPATH)3
  232. X      XAPPLOADDIR = $(LIBDIR)/app-defaults
  233. X
  234. X       FONTCFLAGS = -t
  235. X
  236. X     INSTAPPFLAGS = $(INSTDATFLAGS)
  237. X
  238. X            IMAKE = imake
  239. X           DEPEND = makedepend
  240. X              RGB = rgb
  241. X            FONTC = bdftosnf
  242. X        MKFONTDIR = mkfontdir
  243. X        MKDIRHIER =     /bin/sh $(BINDIR)/mkdirhier.sh
  244. X
  245. X        CONFIGSRC = $(TOP)/config
  246. X        CLIENTSRC = $(TOP)/clients
  247. X          DEMOSRC = $(TOP)/demos
  248. X           LIBSRC = $(TOP)/lib
  249. X          FONTSRC = $(TOP)/fonts
  250. X       INCLUDESRC = $(TOP)/X11
  251. X        SERVERSRC = $(TOP)/server
  252. X          UTILSRC = $(TOP)/util
  253. X        SCRIPTSRC = $(UTILSRC)/scripts
  254. X       EXAMPLESRC = $(TOP)/examples
  255. X       CONTRIBSRC = $(TOP)/../contrib
  256. X           DOCSRC = $(TOP)/doc
  257. X           RGBSRC = $(TOP)/rgb
  258. X        DEPENDSRC = $(UTILSRC)/makedepend
  259. X         IMAKESRC = $(CONFIGSRC)
  260. X         XAUTHSRC = $(LIBSRC)/Xau
  261. X          XLIBSRC = $(LIBSRC)/X
  262. X           XMUSRC = $(LIBSRC)/Xmu
  263. X       TOOLKITSRC = $(LIBSRC)/Xt
  264. X       AWIDGETSRC = $(LIBSRC)/Xaw
  265. X       OLDXLIBSRC = $(LIBSRC)/oldX
  266. X      XDMCPLIBSRC = $(LIBSRC)/Xdmcp
  267. X      BDFTOSNFSRC = $(FONTSRC)/bdftosnf
  268. X     MKFONTDIRSRC = $(FONTSRC)/mkfontdir
  269. X     EXTENSIONSRC = $(TOP)/extensions
  270. X
  271. X  DEPEXTENSIONLIB =  $(USRLIBDIR)/libXext.a
  272. X     EXTENSIONLIB =               -lXext
  273. X
  274. X          DEPXLIB = $(DEPEXTENSIONLIB)  $(USRLIBDIR)/libX11.a
  275. X             XLIB = $(EXTENSIONLIB)               -lX11
  276. X
  277. X      DEPXAUTHLIB =  $(USRLIBDIR)/libXau.a
  278. X         XAUTHLIB =               -lXau
  279. X
  280. X        DEPXMULIB =  $(USRLIBDIR)/libXmu.a
  281. X           XMULIB =               -lXmu
  282. X
  283. X       DEPOLDXLIB =  $(USRLIBDIR)/liboldX.a
  284. X          OLDXLIB =               -loldX
  285. X
  286. X      DEPXTOOLLIB =  $(USRLIBDIR)/libXt.a
  287. X         XTOOLLIB =               -lXt
  288. X
  289. X        DEPXAWLIB =  $(USRLIBDIR)/libXaw.a
  290. X           XAWLIB =               -lXaw
  291. X
  292. X LINTEXTENSIONLIB =  $(USRLIBDIR)/llib-lXext.ln
  293. X         LINTXLIB =  $(USRLIBDIR)/llib-lX11.ln
  294. X          LINTXMU =  $(USRLIBDIR)/llib-lXmu.ln
  295. X        LINTXTOOL =  $(USRLIBDIR)/llib-lXt.ln
  296. X          LINTXAW =  $(USRLIBDIR)/llib-lXaw.ln
  297. X
  298. X          DEPLIBS = $(LOCAL_LIBRARIES)
  299. X
  300. X         DEPLIBS1 = $(DEPLIBS)
  301. X         DEPLIBS2 = $(DEPLIBS)
  302. X         DEPLIBS3 = $(DEPLIBS)
  303. X
  304. X###########################################################################
  305. X# Imake rules for building libraries, programs, scripts, and data files
  306. X# rules:  $XConsortium: Imake.rules,v 1.70 90/05/04 16:57:30 keith Exp $
  307. X
  308. X###########################################################################
  309. X# start of Imakefile
  310. X
  311. XCDEBUGFLAGS = -systype bsd43 -O
  312. X
  313. XSUBDIRS=    V fsim
  314. X
  315. Xall::
  316. X    @case '${MFLAGS}' in *[ik]*) set +e;; esac; \
  317. X    for i in $(SUBDIRS) ;\
  318. X    do \
  319. X        (cd $$i ; echo "making" all "in $(CURRENT_DIR)/$$i..."; \
  320. X            $(MAKE) $(MFLAGS) CDEBUFLAGS='$(CDEBUGFLAGS)' all); \
  321. X    done
  322. X
  323. Xdepend::
  324. X    @case '${MFLAGS}' in *[ik]*) set +e;; esac; \
  325. X    for i in $(SUBDIRS) ;\
  326. X    do \
  327. X        (cd $$i ; echo "depending" "in $(CURRENT_DIR)/$$i..."; \
  328. X            $(MAKE) $(MFLAGS)   depend); \
  329. X    done
  330. X
  331. X###########################################################################
  332. X# common rules for all Makefiles - do not edit
  333. X
  334. Xemptyrule::
  335. X
  336. Xclean::
  337. X    $(RM_CMD) \#*
  338. X
  339. XMakefile::
  340. X    -@if [ -f Makefile ]; then \
  341. X        echo "    $(RM) Makefile.bak; $(MV) Makefile Makefile.bak"; \
  342. X        $(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \
  343. X    else exit 0; fi
  344. X    $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)
  345. X
  346. Xtags::
  347. X    $(TAGS) -w *.[ch]
  348. X    $(TAGS) -xw *.[ch] > TAGS
  349. X
  350. X###########################################################################
  351. X# rules for building in SUBDIRS - do not edit
  352. X
  353. Xinstall::
  354. X    @case '${MFLAGS}' in *[ik]*) set +e;; esac; \
  355. X    for i in $(SUBDIRS) ;\
  356. X    do \
  357. X        (cd $$i ; echo "installing" "in $(CURRENT_DIR)/$$i..."; \
  358. X            $(MAKE) $(MFLAGS) DESTDIR='$(DESTDIR)' install); \
  359. X    done
  360. X
  361. Xinstall.man::
  362. X    @case '${MFLAGS}' in *[ik]*) set +e;; esac; \
  363. X    for i in $(SUBDIRS) ;\
  364. X    do \
  365. X        (cd $$i ; echo "installing man pages" "in $(CURRENT_DIR)/$$i..."; \
  366. X            $(MAKE) $(MFLAGS) DESTDIR='$(DESTDIR)' install.man); \
  367. X    done
  368. X
  369. Xclean::
  370. X    @case '${MFLAGS}' in *[ik]*) set +e;; esac; \
  371. X    for i in $(SUBDIRS) ;\
  372. X    do \
  373. X        (cd $$i ; echo "cleaning" "in $(CURRENT_DIR)/$$i..."; \
  374. X            $(MAKE) $(MFLAGS) RM_CMD='$(RM_CMD)' clean); \
  375. X    done
  376. X
  377. Xtags::
  378. X    @case '${MFLAGS}' in *[ik]*) set +e;; esac; \
  379. X    for i in $(SUBDIRS) ;\
  380. X    do \
  381. X        (cd $$i ; echo "tagging" "in $(CURRENT_DIR)/$$i..."; \
  382. X            $(MAKE) $(MFLAGS) TAGS='$(TAGS)' tags); \
  383. X    done
  384. X
  385. XMakefiles::
  386. X    @case '${MFLAGS}' in *[ik]*) set +e;; esac; \
  387. X    for i in $(SUBDIRS) ;\
  388. X    do \
  389. X        echo "making Makefiles in $(CURRENT_DIR)/$$i..."; \
  390. X        case "$$i" in \
  391. X        ./?*/?*/?*/?*) newtop=../../../../ sub=subsubsubsub;; \
  392. X        ./?*/?*/?*) newtop=../../../ sub=subsubsub;; \
  393. X        ./?*/?*)    newtop=../../ sub=subsub;; \
  394. X        ./?*)       newtop=../ sub=sub;; \
  395. X        */?*/?*/?*)    newtop=../../../../ sub=subsubsubsub;; \
  396. X        */?*/?*)    newtop=../../../ sub=subsubsub;; \
  397. X        */?*)       newtop=../../ sub=subsub;; \
  398. X        *)        newtop=../ sub=sub;; \
  399. X        esac; \
  400. X        case "$(TOP)" in \
  401. X        /?*) newtop=  upprefix=  ;; \
  402. X        *) upprefix=../ ;; \
  403. X        esac; \
  404. X        $(MAKE) $${sub}dirMakefiles UPPREFIX=$$upprefix NEWTOP=$$newtop \
  405. X        MAKEFILE_SUBDIR=$$i NEW_CURRENT_DIR=$(CURRENT_DIR)/$$i;\
  406. X    done
  407. X
  408. XsubdirMakefiles:
  409. X    $(RM) $(MAKEFILE_SUBDIR)/Makefile.bak
  410. X    -@if [ -f $(MAKEFILE_SUBDIR)/Makefile ]; then \
  411. X    echo "    $(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak"; \
  412. X    $(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak; \
  413. X    else exit 0; fi
  414. X    cd $(MAKEFILE_SUBDIR); $(IMAKE_CMD) -DTOPDIR=$(UPPREFIX)$(TOP) -DCURDIR=$(NEW_CURRENT_DIR); \
  415. X    $(MAKE) $(MFLAGS) Makefiles
  416. X
  417. XsubsubdirMakefiles:
  418. X    $(RM) $(MAKEFILE_SUBDIR)/Makefile.bak
  419. X    -@if [ -f $(MAKEFILE_SUBDIR)/Makefile ]; then \
  420. X    echo "    $(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak"; \
  421. X    $(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak; \
  422. X    else exit 0; fi
  423. X    cd $(MAKEFILE_SUBDIR); $(IMAKE_CMD) -DTOPDIR=$(UPPREFIX)$(UPPREFIX)$(TOP) -DCURDIR=$(NEW_CURRENT_DIR); \
  424. X    $(MAKE) $(MFLAGS) Makefiles
  425. X
  426. XsubsubsubdirMakefiles:
  427. X    $(RM) $(MAKEFILE_SUBDIR)/Makefile.bak
  428. X    -@if [ -f $(MAKEFILE_SUBDIR)/Makefile ]; then \
  429. X    echo "    $(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak"; \
  430. X    $(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak; \
  431. X    else exit 0; fi
  432. X    cd $(MAKEFILE_SUBDIR); $(IMAKE_CMD) -DTOPDIR=$(UPPREFIX)$(UPPREFIX)$(UPPREFIX)$(TOP) -DCURDIR=$(NEW_CURRENT_DIR); \
  433. X    $(MAKE) $(MFLAGS) Makefiles
  434. X
  435. XsubsubsubsubdirMakefiles:
  436. X    $(RM) $(MAKEFILE_SUBDIR)/Makefile.bak
  437. X    -@if [ -f $(MAKEFILE_SUBDIR)/Makefile ]; then \
  438. X    echo "    $(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak"; \
  439. X    $(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak; \
  440. X    else exit 0; fi
  441. X    cd $(MAKEFILE_SUBDIR); $(IMAKE_CMD) -DTOPDIR=$(UPPREFIX)$(UPPREFIX)$(UPPREFIX)$(UPPREFIX)$(TOP) -DCURDIR=$(NEW_CURRENT_DIR); \
  442. X    $(MAKE) $(MFLAGS) Makefiles
  443. X
  444. Xincludes::
  445. X    @case '${MFLAGS}' in *[ik]*) set +e;; esac; \
  446. X    for i in $(SUBDIRS) ;\
  447. X    do \
  448. X        (cd $$i ; echo including "in $(CURRENT_DIR)/$$i..."; \
  449. X            $(MAKE) $(MFLAGS)   includes); \
  450. X    done
  451. X
  452. X###########################################################################
  453. X# dependencies generated by makedepend
  454. X
  455. END_OF_FILE
  456. if test 14158 -ne `wc -c <'acm/Makefile'`; then
  457.     echo shar: \"'acm/Makefile'\" unpacked with wrong size!
  458. fi
  459. # end of 'acm/Makefile'
  460. fi
  461. if test -f 'acm/V/Makefile' -a "${1}" != "-c" ; then 
  462.   echo shar: Will not clobber existing file \"'acm/V/Makefile'\"
  463. else
  464. echo shar: Extracting \"'acm/V/Makefile'\" \(14160 characters\)
  465. sed "s/^X//" >'acm/V/Makefile' <<'END_OF_FILE'
  466. X# Makefile generated by imake - do not edit!
  467. X# $XConsortium: imake.c,v 1.51 89/12/12 12:37:30 jim Exp $
  468. X
  469. X###########################################################################
  470. X# Makefile generated from "Imake.tmpl" and <Imakefile>
  471. X# $XConsortium: Imake.tmpl,v 1.77 89/12/18 17:01:37 jim Exp $
  472. X#
  473. X# Platform-specific parameters may be set in the appropriate .cf
  474. X# configuration files.  Site-wide parameters may be set in the file
  475. X# site.def.  Full rebuilds are recommended if any parameters are changed.
  476. X#
  477. X# If your C preprocessor doesn't define any unique symbols, you'll need
  478. X# to set BOOTSTRAPCFLAGS when rebuilding imake (usually when doing
  479. X# "make Makefile", "make Makefiles", or "make World").
  480. X#
  481. X# If you absolutely can't get imake to work, you'll need to set the
  482. X# variables at the top of each Makefile as well as the dependencies at the
  483. X# bottom (makedepend will do this automatically).
  484. X#
  485. X
  486. X###########################################################################
  487. X# platform-specific configuration parameters - edit Mips.cf to change
  488. X
  489. X# platform:  $XConsortium: Mips.cf,v 1.2 89/01/11 14:58:19 jim Exp $
  490. X# operating system:             RISCOS
  491. X
  492. X         SYSVTYPE = -systype sysv
  493. X          BSDTYPE = -systype bsd43
  494. X         SYSVDEFS = -DMips -DSYSV
  495. X          BSDDEFS = -DMips -DBSD43
  496. X         SYSVINCS = -I$(DESTDIR)/usr/include/bsd
  497. X          BSDINCS =
  498. X         SYSVLIBS = -lbsd -lmld
  499. X          BSDLIBS = -lmld
  500. X
  501. X          SYSTYPE = $(BSDTYPE)
  502. X          SYSDEFS = $(BSDDEFS)
  503. X          SYSINCS = $(BSDINCS)
  504. X          SYSLIBS = $(BSDLIBS)
  505. X
  506. X     OPTIM = -O -Olimit 2000 -Wf,-XNd8400,-XNp12000
  507. X     CCOPT = -signed
  508. X   DEFINES = -D_NO_PROTO
  509. XSYSVCFLAGS = $(OPTIM) $(CCOPT) $(SYSVTYPE) $(INCLUDES) $(SYSVDEFS) $(SYSVINCS) $(DEFINES)
  510. X BSDCFLAGS = $(OPTIM) $(CCOPT) $(BSDTYPE)  $(INCLUDES) $(BSDDEFS)  $(BSDINCS)  $(DEFINES)
  511. X
  512. X           ETCDIR = /etc
  513. X          ULIBDIR = /usr/lib
  514. X
  515. X      XINSTALLDIR = RISCwindows4.0
  516. X     INSTALLFLAGS = -m 0555
  517. X        RS1210DIR = $(DESTDIR)/usr/$(XINSTALLDIR)/RS1210
  518. X    CONTRIBBINDIR = $(DESTDIR)/usr/$(XINSTALLDIR)/contrib/bin
  519. XCONTRIBAPPSDEFDIR = $(DESTDIR)/usr/$(XINSTALLDIR)/contrib/lib/app-defaults
  520. X    CONTRIBMANDIR = $(DESTDIR)/usr/$(XINSTALLDIR)/contrib/man
  521. X    CONTRIBSRCDIR = $(DESTDIR)/usr/$(XINSTALLDIR)/contrib/src
  522. X     RS1210LIBDIR = $(LIBDIR)/ncd
  523. X
  524. X          BINPATH = /usr/bin/X11
  525. X          LIBPATH = /usr/lib/X11
  526. X          ETCPATH = /usr/etc/X11
  527. X          ADMPATH = /usr/adm
  528. X          NCDPATH = /usr/X11/ncd
  529. X       NCDLIBPATH = $(LIBPATH)/ncd
  530. X        XINITPATH = $(LIBPATH)/xinit
  531. X          XDMPATH = $(ETCPATH)/xdm
  532. X          UWMPATH = $(LIBPATH)/uwm
  533. X          AWMPATH = $(LIBPATH)/awm
  534. X          MWMPATH = $(LIBPATH)/mwm
  535. X          TWMPATH = $(LIBPATH)/twm
  536. X     XAPPLOADPATH = $(LIBPATH)/app-defaults
  537. X        RS1210SRC = $(TOP)/rs1210
  538. X
  539. X       MOTIFSRC = $(TOP)/motif
  540. X        MLIBSRC = $(MOTIFSRC)/lib
  541. X     MCLIENTSRC = $(MOTIFSRC)/clients
  542. X       MDEMOSRC = $(MOTIFSRC)/demos
  543. X    MTOOLKITSRC = $(MOTIFSRC)/X11R4/lib/Xt
  544. X     MWIDGETSRC = $(MLIBSRC)/Xm
  545. X   INCLUDEXMSRC = $(MLIBSRC)/Xm
  546. X   MRESOURCESRC = $(MLIBSRC)/Mrm
  547. X         MWMDIR = $(LIBDIR)/Mwm
  548. X     DEMOBINDIR = $(DESTDIR)/usr/$(XINSTALLDIR)/demos/bin
  549. X     DEMOSRCDIR = $(DESTDIR)/usr/$(XINSTALLDIR)/demos/src
  550. X       MINCLUDE = $(TOP)/include
  551. X         UILSRC = $(MCLIENTSRC)/uil
  552. X            UIL = $(UILSRC)/uil
  553. X
  554. X      XMTOOLLIB = $(MTOOLKITSRC)/libXt.a
  555. X          XMLIB = $(MWIDGETSRC)/libXm.a
  556. X   MRESOURCELIB = $(MRESOURCESRC)/libMrm.a
  557. X         UILLIB = $(UILSRC)/libUil.a
  558. X
  559. X  BUILDTOOLSDIR = $(TOP)/buildtools
  560. XCROSSENVOVERRIDE= DESTROOT=/ COMP_TARGET_ROOT=/ ETCDIR=/etc ULIBDIR=/usr/lib
  561. X
  562. X###########################################################################
  563. X# site-specific configuration parameters - edit site.def to change
  564. X
  565. X# site:  $XConsortium: site.def,v 1.21 89/12/06 11:46:50 jim Exp $
  566. X
  567. X            SHELL =     /bin/sh
  568. X
  569. X              TOP = ../.
  570. X      CURRENT_DIR = ./V
  571. X
  572. X               AR = ar clr
  573. X  BOOTSTRAPCFLAGS = $(SYSDEFS)
  574. X               CC = cc
  575. X
  576. X         COMPRESS = compress
  577. X              CPP = /lib/cpp $(STD_CPP_DEFINES)
  578. X    PREPROCESSCMD = cc -E $(STD_CPP_DEFINES)
  579. X          INSTALL = $(ETCDIR)/mipsinstall
  580. X               LD = ld
  581. X             LINT = lint
  582. X      LINTLIBFLAG = -C
  583. X         LINTOPTS = -axz
  584. X               LN = ln -s
  585. X             MAKE = make ETCDIR='$(ETCDIR)' ULIBDIR='$(ULIBDIR)'
  586. X               MV = mv
  587. X               CP = cp
  588. X           RANLIB = /bin/true
  589. X  RANLIBINSTFLAGS =
  590. X               RM = rm -f
  591. X     STD_INCLUDES =
  592. X  STD_CPP_DEFINES = $(SYSDEFS)
  593. X      STD_DEFINES = $(SYSDEFS) $(SYSINCS)
  594. X EXTRA_LOAD_FLAGS =
  595. X  EXTRA_LIBRARIES = $(SYSLIBS)
  596. X             TAGS = ctags
  597. X
  598. X   SIGNAL_DEFINES = -DSIGNALRETURNSINT
  599. X
  600. X    PROTO_DEFINES =
  601. X
  602. X     INSTPGMFLAGS =
  603. X
  604. X     INSTBINFLAGS = -m 0755
  605. X     INSTUIDFLAGS = -m 4755
  606. X     INSTLIBFLAGS = -m 0664
  607. X     INSTINCFLAGS = -m 0444
  608. X     INSTMANFLAGS = -m 0444
  609. X     INSTDATFLAGS = -m 0444
  610. X    INSTKMEMFLAGS = -g sys -m 2755
  611. X
  612. X          DESTDIR = $(DESTROOT)
  613. X
  614. X     TOP_INCLUDES = -I$(INCROOT)
  615. X
  616. X      CDEBUGFLAGS = $(OPTIM) $(CCOPT) $(SYSTYPE)
  617. X        CCOPTIONS =
  618. X      COMPATFLAGS =
  619. X
  620. X      ALLINCLUDES = $(STD_INCLUDES) $(TOP_INCLUDES) $(INCLUDES) $(EXTRA_INCLUDES)
  621. X       ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(PROTO_DEFINES) $(DEFINES) $(COMPATFLAGS) $(EXT_DEFINES)
  622. X           CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(ALLDEFINES)
  623. X        LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES)
  624. X           LDLIBS = $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
  625. X        LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS)
  626. X   LDCOMBINEFLAGS = -X -r
  627. X
  628. X        MACROFILE = Mips.cf
  629. X           RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut *.u *.b
  630. X
  631. X    IMAKE_DEFINES =
  632. X
  633. X         IRULESRC = $(CONFIGDIR)
  634. X        IMAKE_CMD = $(IMAKE) -DUseInstalled -I$(IRULESRC) $(IMAKE_DEFINES)
  635. X
  636. X     ICONFIGFILES = $(IRULESRC)/Imake.tmpl $(IRULESRC)/Imake.rules \
  637. X            $(IRULESRC)/Project.tmpl $(IRULESRC)/site.def \
  638. X            $(IRULESRC)/$(MACROFILE) $(EXTRA_ICONFIGFILES)
  639. X
  640. X###########################################################################
  641. X# X Window System Build Parameters
  642. X# $XConsortium: Project.tmpl,v 1.63 89/12/18 16:46:44 jim Exp $
  643. X
  644. X###########################################################################
  645. X# X Window System make variables; this need to be coordinated with rules
  646. X# $XConsortium: Project.tmpl,v 1.63 89/12/18 16:46:44 jim Exp $
  647. X
  648. X          PATHSEP = /
  649. X        USRLIBDIR = $(DESTDIR)/usr/$(XINSTALLDIR)/lib
  650. X           BINDIR = $(DESTDIR)/usr/$(XINSTALLDIR)/bin
  651. X          INCROOT = $(DESTDIR)/usr/$(XINSTALLDIR)/include
  652. X     BUILDINCROOT = $(TOP)
  653. X      BUILDINCDIR = $(BUILDINCROOT)/X11
  654. X      BUILDINCTOP = ..
  655. X           INCDIR = $(INCROOT)/X11
  656. X           ADMDIR = $(DESTDIR)/usr/adm
  657. X           LIBDIR = $(USRLIBDIR)/X11
  658. X        CONFIGDIR = $(LIBDIR)/config
  659. X       LINTLIBDIR = $(USRLIBDIR)/lint
  660. X
  661. X          FONTDIR = $(LIBDIR)/fonts
  662. X         XINITDIR = $(LIBDIR)/xinit
  663. X           XDMDIR = $(DESTDIR)/usr/X11/etc/xdm
  664. X           AWMDIR = $(LIBDIR)/awm
  665. X           TWMDIR = $(LIBDIR)/twm
  666. X           GWMDIR = $(LIBDIR)/gwm
  667. X          MANPATH = $(DESTDIR)/usr/$(XINSTALLDIR)/man/cat
  668. X    MANSOURCEPATH = $(MANPATH)/man
  669. X           MANDIR = $(MANSOURCEPATH)1
  670. X        LIBMANDIR = $(MANSOURCEPATH)3
  671. X      XAPPLOADDIR = $(LIBDIR)/app-defaults
  672. X
  673. X       FONTCFLAGS = -t
  674. X
  675. X     INSTAPPFLAGS = $(INSTDATFLAGS)
  676. X
  677. X            IMAKE = imake
  678. X           DEPEND = makedepend
  679. X              RGB = rgb
  680. X            FONTC = bdftosnf
  681. X        MKFONTDIR = mkfontdir
  682. X        MKDIRHIER =     /bin/sh $(BINDIR)/mkdirhier.sh
  683. X
  684. X        CONFIGSRC = $(TOP)/config
  685. X        CLIENTSRC = $(TOP)/clients
  686. X          DEMOSRC = $(TOP)/demos
  687. X           LIBSRC = $(TOP)/lib
  688. X          FONTSRC = $(TOP)/fonts
  689. X       INCLUDESRC = $(TOP)/X11
  690. X        SERVERSRC = $(TOP)/server
  691. X          UTILSRC = $(TOP)/util
  692. X        SCRIPTSRC = $(UTILSRC)/scripts
  693. X       EXAMPLESRC = $(TOP)/examples
  694. X       CONTRIBSRC = $(TOP)/../contrib
  695. X           DOCSRC = $(TOP)/doc
  696. X           RGBSRC = $(TOP)/rgb
  697. X        DEPENDSRC = $(UTILSRC)/makedepend
  698. X         IMAKESRC = $(CONFIGSRC)
  699. X         XAUTHSRC = $(LIBSRC)/Xau
  700. X          XLIBSRC = $(LIBSRC)/X
  701. X           XMUSRC = $(LIBSRC)/Xmu
  702. X       TOOLKITSRC = $(LIBSRC)/Xt
  703. X       AWIDGETSRC = $(LIBSRC)/Xaw
  704. X       OLDXLIBSRC = $(LIBSRC)/oldX
  705. X      XDMCPLIBSRC = $(LIBSRC)/Xdmcp
  706. X      BDFTOSNFSRC = $(FONTSRC)/bdftosnf
  707. X     MKFONTDIRSRC = $(FONTSRC)/mkfontdir
  708. X     EXTENSIONSRC = $(TOP)/extensions
  709. X
  710. X  DEPEXTENSIONLIB =  $(USRLIBDIR)/libXext.a
  711. X     EXTENSIONLIB =               -lXext
  712. X
  713. X          DEPXLIB = $(DEPEXTENSIONLIB)  $(USRLIBDIR)/libX11.a
  714. X             XLIB = $(EXTENSIONLIB)               -lX11
  715. X
  716. X      DEPXAUTHLIB =  $(USRLIBDIR)/libXau.a
  717. X         XAUTHLIB =               -lXau
  718. X
  719. X        DEPXMULIB =  $(USRLIBDIR)/libXmu.a
  720. X           XMULIB =               -lXmu
  721. X
  722. X       DEPOLDXLIB =  $(USRLIBDIR)/liboldX.a
  723. X          OLDXLIB =               -loldX
  724. X
  725. X      DEPXTOOLLIB =  $(USRLIBDIR)/libXt.a
  726. X         XTOOLLIB =               -lXt
  727. X
  728. X        DEPXAWLIB =  $(USRLIBDIR)/libXaw.a
  729. X           XAWLIB =               -lXaw
  730. X
  731. X LINTEXTENSIONLIB =  $(USRLIBDIR)/llib-lXext.ln
  732. X         LINTXLIB =  $(USRLIBDIR)/llib-lX11.ln
  733. X          LINTXMU =  $(USRLIBDIR)/llib-lXmu.ln
  734. X        LINTXTOOL =  $(USRLIBDIR)/llib-lXt.ln
  735. X          LINTXAW =  $(USRLIBDIR)/llib-lXaw.ln
  736. X
  737. X          DEPLIBS = $(LOCAL_LIBRARIES)
  738. X
  739. X         DEPLIBS1 = $(DEPLIBS)
  740. X         DEPLIBS2 = $(DEPLIBS)
  741. X         DEPLIBS3 = $(DEPLIBS)
  742. X
  743. X###########################################################################
  744. X# Imake rules for building libraries, programs, scripts, and data files
  745. X# rules:  $XConsortium: Imake.rules,v 1.70 90/05/04 16:57:30 keith Exp $
  746. X
  747. X###########################################################################
  748. X# start of Imakefile
  749. X
  750. XCDEBUGFLAGS = -systype bsd43 -O
  751. X
  752. XSUBDIRS=    lib
  753. X
  754. Xall::
  755. X    @case '${MFLAGS}' in *[ik]*) set +e;; esac; \
  756. X    for i in $(SUBDIRS) ;\
  757. X    do \
  758. X        (cd $$i ; echo "making" all "in $(CURRENT_DIR)/$$i..."; \
  759. X            $(MAKE) $(MFLAGS) CDEBUFLAGS='$(CDEBUGFLAGS)' all); \
  760. X    done
  761. X
  762. Xdepend::
  763. X    @case '${MFLAGS}' in *[ik]*) set +e;; esac; \
  764. X    for i in $(SUBDIRS) ;\
  765. X    do \
  766. X        (cd $$i ; echo "depending" "in $(CURRENT_DIR)/$$i..."; \
  767. X            $(MAKE) $(MFLAGS)   depend); \
  768. X    done
  769. X
  770. X###########################################################################
  771. X# common rules for all Makefiles - do not edit
  772. X
  773. Xemptyrule::
  774. X
  775. Xclean::
  776. X    $(RM_CMD) \#*
  777. X
  778. XMakefile::
  779. X    -@if [ -f Makefile ]; then \
  780. X        echo "    $(RM) Makefile.bak; $(MV) Makefile Makefile.bak"; \
  781. X        $(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \
  782. X    else exit 0; fi
  783. X    $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)
  784. X
  785. Xtags::
  786. X    $(TAGS) -w *.[ch]
  787. X    $(TAGS) -xw *.[ch] > TAGS
  788. X
  789. X###########################################################################
  790. X# rules for building in SUBDIRS - do not edit
  791. X
  792. Xinstall::
  793. X    @case '${MFLAGS}' in *[ik]*) set +e;; esac; \
  794. X    for i in $(SUBDIRS) ;\
  795. X    do \
  796. X        (cd $$i ; echo "installing" "in $(CURRENT_DIR)/$$i..."; \
  797. X            $(MAKE) $(MFLAGS) DESTDIR='$(DESTDIR)' install); \
  798. X    done
  799. X
  800. Xinstall.man::
  801. X    @case '${MFLAGS}' in *[ik]*) set +e;; esac; \
  802. X    for i in $(SUBDIRS) ;\
  803. X    do \
  804. X        (cd $$i ; echo "installing man pages" "in $(CURRENT_DIR)/$$i..."; \
  805. X            $(MAKE) $(MFLAGS) DESTDIR='$(DESTDIR)' install.man); \
  806. X    done
  807. X
  808. Xclean::
  809. X    @case '${MFLAGS}' in *[ik]*) set +e;; esac; \
  810. X    for i in $(SUBDIRS) ;\
  811. X    do \
  812. X        (cd $$i ; echo "cleaning" "in $(CURRENT_DIR)/$$i..."; \
  813. X            $(MAKE) $(MFLAGS) RM_CMD='$(RM_CMD)' clean); \
  814. X    done
  815. X
  816. Xtags::
  817. X    @case '${MFLAGS}' in *[ik]*) set +e;; esac; \
  818. X    for i in $(SUBDIRS) ;\
  819. X    do \
  820. X        (cd $$i ; echo "tagging" "in $(CURRENT_DIR)/$$i..."; \
  821. X            $(MAKE) $(MFLAGS) TAGS='$(TAGS)' tags); \
  822. X    done
  823. X
  824. XMakefiles::
  825. X    @case '${MFLAGS}' in *[ik]*) set +e;; esac; \
  826. X    for i in $(SUBDIRS) ;\
  827. X    do \
  828. X        echo "making Makefiles in $(CURRENT_DIR)/$$i..."; \
  829. X        case "$$i" in \
  830. X        ./?*/?*/?*/?*) newtop=../../../../ sub=subsubsubsub;; \
  831. X        ./?*/?*/?*) newtop=../../../ sub=subsubsub;; \
  832. X        ./?*/?*)    newtop=../../ sub=subsub;; \
  833. X        ./?*)       newtop=../ sub=sub;; \
  834. X        */?*/?*/?*)    newtop=../../../../ sub=subsubsubsub;; \
  835. X        */?*/?*)    newtop=../../../ sub=subsubsub;; \
  836. X        */?*)       newtop=../../ sub=subsub;; \
  837. X        *)        newtop=../ sub=sub;; \
  838. X        esac; \
  839. X        case "$(TOP)" in \
  840. X        /?*) newtop=  upprefix=  ;; \
  841. X        *) upprefix=../ ;; \
  842. X        esac; \
  843. X        $(MAKE) $${sub}dirMakefiles UPPREFIX=$$upprefix NEWTOP=$$newtop \
  844. X        MAKEFILE_SUBDIR=$$i NEW_CURRENT_DIR=$(CURRENT_DIR)/$$i;\
  845. X    done
  846. X
  847. XsubdirMakefiles:
  848. X    $(RM) $(MAKEFILE_SUBDIR)/Makefile.bak
  849. X    -@if [ -f $(MAKEFILE_SUBDIR)/Makefile ]; then \
  850. X    echo "    $(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak"; \
  851. X    $(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak; \
  852. X    else exit 0; fi
  853. X    cd $(MAKEFILE_SUBDIR); $(IMAKE_CMD) -DTOPDIR=$(UPPREFIX)$(TOP) -DCURDIR=$(NEW_CURRENT_DIR); \
  854. X    $(MAKE) $(MFLAGS) Makefiles
  855. X
  856. XsubsubdirMakefiles:
  857. X    $(RM) $(MAKEFILE_SUBDIR)/Makefile.bak
  858. X    -@if [ -f $(MAKEFILE_SUBDIR)/Makefile ]; then \
  859. X    echo "    $(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak"; \
  860. X    $(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak; \
  861. X    else exit 0; fi
  862. X    cd $(MAKEFILE_SUBDIR); $(IMAKE_CMD) -DTOPDIR=$(UPPREFIX)$(UPPREFIX)$(TOP) -DCURDIR=$(NEW_CURRENT_DIR); \
  863. X    $(MAKE) $(MFLAGS) Makefiles
  864. X
  865. XsubsubsubdirMakefiles:
  866. X    $(RM) $(MAKEFILE_SUBDIR)/Makefile.bak
  867. X    -@if [ -f $(MAKEFILE_SUBDIR)/Makefile ]; then \
  868. X    echo "    $(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak"; \
  869. X    $(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak; \
  870. X    else exit 0; fi
  871. X    cd $(MAKEFILE_SUBDIR); $(IMAKE_CMD) -DTOPDIR=$(UPPREFIX)$(UPPREFIX)$(UPPREFIX)$(TOP) -DCURDIR=$(NEW_CURRENT_DIR); \
  872. X    $(MAKE) $(MFLAGS) Makefiles
  873. X
  874. XsubsubsubsubdirMakefiles:
  875. X    $(RM) $(MAKEFILE_SUBDIR)/Makefile.bak
  876. X    -@if [ -f $(MAKEFILE_SUBDIR)/Makefile ]; then \
  877. X    echo "    $(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak"; \
  878. X    $(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak; \
  879. X    else exit 0; fi
  880. X    cd $(MAKEFILE_SUBDIR); $(IMAKE_CMD) -DTOPDIR=$(UPPREFIX)$(UPPREFIX)$(UPPREFIX)$(UPPREFIX)$(TOP) -DCURDIR=$(NEW_CURRENT_DIR); \
  881. X    $(MAKE) $(MFLAGS) Makefiles
  882. X
  883. Xincludes::
  884. X    @case '${MFLAGS}' in *[ik]*) set +e;; esac; \
  885. X    for i in $(SUBDIRS) ;\
  886. X    do \
  887. X        (cd $$i ; echo including "in $(CURRENT_DIR)/$$i..."; \
  888. X            $(MAKE) $(MFLAGS)   includes); \
  889. X    done
  890. X
  891. X###########################################################################
  892. X# dependencies generated by makedepend
  893. X
  894. END_OF_FILE
  895. if test 14160 -ne `wc -c <'acm/V/Makefile'`; then
  896.     echo shar: \"'acm/V/Makefile'\" unpacked with wrong size!
  897. fi
  898. # end of 'acm/V/Makefile'
  899. fi
  900. if test -f 'acm/fsim/m61a1.c' -a "${1}" != "-c" ; then 
  901.   echo shar: Will not clobber existing file \"'acm/fsim/m61a1.c'\"
  902. else
  903. echo shar: Extracting \"'acm/fsim/m61a1.c'\" \(14922 characters\)
  904. sed "s/^X//" >'acm/fsim/m61a1.c' <<'END_OF_FILE'
  905. X/*
  906. X *    xflight : an aerial combat simulator for X
  907. X *
  908. X *    Written by Riley Rainey,  riley@mips.com
  909. X *
  910. X *    Permission to use, copy, modify and distribute (without charge) this
  911. X *    software, documentation, images, etc. is granted, provided that this 
  912. X *    comment and the author's name is retained.
  913. X *
  914. X */
  915. X#include "pm.h"
  916. X#include <stdio.h>
  917. X#include <string.h>
  918. X#include <math.h>
  919. X
  920. X#define BORE_CROSS_SIZE    7
  921. X#define MUZZLE_VELOCITY (3.2808 * 1036.0)
  922. X#define TRACER_MOD    10    
  923. X#define OFFSET_ANGLE    (DEGtoRAD(3.0))        /* the gun points up at this angle */
  924. X#define RATE_OF_FIRE    (3000.0 / 60.0)        /* rounds per second */
  925. X#define FUZZ        (DEGtoRAD(1.0))        /* distribution due to vibration */
  926. X
  927. Xint select_m61a1();
  928. Xint display_m61a1();
  929. Xint update_m61a1();
  930. Xint press_m61a1();
  931. Xint release_m61a1();
  932. Xextern craftType * lookupCraft();
  933. Xextern FILE * acm_fopen();
  934. Xvoid lcos();
  935. X
  936. Xint    cdebug = 0;        /* set to 1 to debug cannon fire */
  937. X
  938. XweaponDesc m61a1Desc = {
  939. X    WK_M61A1,
  940. X    select_m61a1,        /* select */
  941. X    update_m61a1,        /* update */
  942. X    display_m61a1,        /* display procedure */
  943. X    press_m61a1,        /* fire */
  944. X    release_m61a1,        /* fire button release */
  945. X    };
  946. X
  947. X/*
  948. X *  We'll take a running average of our pitch and yaw rates to keep the
  949. X *  aiming reticle from jumping all over the screen.
  950. X */
  951. X
  952. X#define HIST    4
  953. X
  954. Xtypedef struct {
  955. X    double    pitch_hist[HIST];
  956. X    double    yaw_hist[HIST];
  957. X    int    cur;        /* current entry in the histories */
  958. X    int    count;        /* number of valid entries */
  959. X    double    pitch_total;
  960. X    double    yaw_total;
  961. X    }    hist_t;
  962. X
  963. Xstatic hist_t    history[MAXPLAYERS];
  964. X
  965. X/*
  966. X *  m61a1 selection function
  967. X *
  968. X *  A selection function normally determines whether there are any weapons
  969. X *  of this type on-board.  If so, and the weapon system is functional
  970. X *  (in other words, undamaged) then return 1; otherwise return 0.
  971. X */
  972. X
  973. Xint select_m61a1 (c)
  974. Xcraft *c; {
  975. X
  976. X    hist_t    *p;
  977. X
  978. X    p = &history[c->index];
  979. X    p->count = p->cur = 0;
  980. X    p->pitch_total = p->yaw_total = 0.0;
  981. X
  982. X    if (c->station[0].type == WK_M61A1 && c->station[0].info > 0)
  983. X        return 1;
  984. X    else
  985. X        return 0;
  986. X
  987. X}
  988. X
  989. X/*
  990. X *  m61a1 display function
  991. X *
  992. X *  Update the HUD display strings associated with this weapon system.
  993. X */
  994. X
  995. X/*ARGSUSED*/
  996. Xint display_m61a1 (c, w, u)
  997. Xcraft *c;
  998. XcraftType *w;
  999. Xviewer *u; {
  1000. X
  1001. X    char    s[16];
  1002. X    register int tx, ty, m;
  1003. X    XSegment seg[2];
  1004. X    Drawable d;
  1005. X    hist_t    *p;
  1006. X
  1007. X    p = &history[c->index];
  1008. X    if ((m = p->cur = p->cur + 1) >= HIST)
  1009. X        m = p->cur = 0;
  1010. X    if (p->count != HIST)
  1011. X        (p->count) ++;
  1012. X    else {    
  1013. X        p->pitch_total -= p->pitch_hist[m];
  1014. X        p->yaw_total -= p->yaw_hist[m];
  1015. X    }
  1016. X    p->pitch_hist[m] = c->q;
  1017. X    p->yaw_hist[m] = c->r;
  1018. X    p->pitch_total += c->q;
  1019. X    p->yaw_total += c->r;
  1020. X
  1021. X        d = (u->v->flags & VPMono) ? (Drawable) u->v->monoPixmap :
  1022. X        (Drawable) u->win;
  1023. X
  1024. X    strcpy (c->leftHUD[0], "LCOS");
  1025. X    sprintf (s, "%.3d M-61A1", c->station[0].info);
  1026. X    strcpy (c->leftHUD[1], s);
  1027. X    if (c->station[0].info3)
  1028. X        strcpy (c->leftHUD[2], "FIRING");
  1029. X    else
  1030. X        strcpy (c->leftHUD[2], "");
  1031. X
  1032. X/*
  1033. X *  Draw the boresight cross
  1034. X */
  1035. X
  1036. X    m = (double) BORE_CROSS_SIZE * (double) u->width /
  1037. X        (double) VIEW_WINDOW_WIDTH + 0.5;
  1038. X
  1039. X    tx = u->xCenter;
  1040. X    ty = u->yCenter - 3 * 9;    /* kludged, for now */
  1041. X    seg[0].x1 = tx - m;
  1042. X    seg[0].x2 = tx + m;
  1043. X    seg[0].y1 = seg[0].y2 = ty;
  1044. X    seg[1].x1 = seg[1].x2 = tx;
  1045. X    seg[1].y1 = ty - m;
  1046. X    seg[1].y2 = ty + m;
  1047. X    XDrawSegments (u->dpy, d, u->gc, seg, 2);
  1048. X
  1049. X/*
  1050. X *  Plot the reticle.
  1051. X */
  1052. X
  1053. X    lcos (c, u);
  1054. X
  1055. X}
  1056. X
  1057. Xint    press_m61a1 (c)
  1058. Xcraft    *c; {
  1059. X    c->station[0].info3 |= 1;
  1060. X    return 0;
  1061. X}
  1062. X
  1063. Xint    release_m61a1 (c)
  1064. Xcraft    *c; {
  1065. X    c->station[0].info3 &= ~1;
  1066. X    return 0;
  1067. X}
  1068. X
  1069. Xextern long random ();
  1070. X
  1071. Xint    update_m61a1 (c)
  1072. Xcraft    *c; {
  1073. X
  1074. X    craft    *m;
  1075. X    int    i;
  1076. X    VPoint    tmp, mvel;
  1077. X    double    fuzz, fuzzAngle, phiY, phiZ, tm, mv = MUZZLE_VELOCITY;
  1078. X
  1079. X    if (c->station[0].info3 == 0)
  1080. X        return 0;
  1081. X
  1082. X/*
  1083. X *  Got any ammunition ?
  1084. X */
  1085. X
  1086. X    if (c->station[0].info <= 0)
  1087. X        return -1;
  1088. X
  1089. X/*
  1090. X *  Allocate a projectile record
  1091. X */
  1092. X
  1093. X    for ((i=0, m= &mtbl[0]); i<MAXPROJECTILES; (++i, ++m))
  1094. X        if (m->type == CT_FREE) {
  1095. X            m->type = CT_CANNON;
  1096. X            break;
  1097. X        }
  1098. X
  1099. X    if (i == MAXPROJECTILES)
  1100. X        return -1;
  1101. X
  1102. X/*
  1103. X *  Determine how far we're fuzzed off the ideal boresight.
  1104. X */
  1105. X
  1106. X    fuzz = ((double)(random() & 32767) +
  1107. X        (double)(random() & 32767)) / 32768.0 - 1.0;
  1108. X    fuzz = fuzz * FUZZ;
  1109. X    fuzzAngle = 2.0 * pi * (double)(random() & 511) / 512.0;
  1110. X
  1111. X/*
  1112. X *  Determine the initial velocity of the projectile stream.
  1113. X */
  1114. X
  1115. X    phiZ = fuzz * sin (fuzzAngle);
  1116. X    phiY = fuzz * cos (fuzzAngle);
  1117. X    tm = mv * cos (OFFSET_ANGLE + phiZ);
  1118. X
  1119. X    tmp.x = tm * cos (phiY); 
  1120. X    tmp.y = tm * sin (phiY); 
  1121. X    tmp.z = mv * sin (-OFFSET_ANGLE + phiZ);
  1122. X    VTransform (&tmp, &(c->trihedral), &mvel);
  1123. X
  1124. X    m->owner = c->index;
  1125. X    m->createTime = curTime;
  1126. X    m->Cg = c->Cg;
  1127. X    m->curRoll = c->curRoll;
  1128. X    m->curPitch = c->curPitch;
  1129. X    m->curHeading = c->curHeading;
  1130. X    m->Cg.x += mvel.x;
  1131. X    m->Cg.y += mvel.y;
  1132. X    m->Cg.z += mvel.z;
  1133. X
  1134. X/*
  1135. X *  Determine the initial position.
  1136. X */
  1137. X
  1138. X    VTransform (&(c->cinfo->wStation[0]), &(c->trihedral), &tmp);
  1139. X    m->Sg.x = c->Sg.x + tmp.x;
  1140. X    m->Sg.y = c->Sg.y + tmp.y;
  1141. X    m->Sg.z = c->Sg.z + tmp.z;
  1142. X    m->prevSg = m->Sg;
  1143. X
  1144. X/*
  1145. X *  Subtract the number of rounds fired.
  1146. X */
  1147. X
  1148. X    m->rounds = RATE_OF_FIRE * deltaT;
  1149. X    m->rounds = (m->rounds > c->station[0].info) ? c->station[0].info : m->rounds;
  1150. X    m->tracerMod = TRACER_MOD;
  1151. X    m->tracerVal = c->station[0].info2 % m->tracerMod;
  1152. X    c->station[0].info -= m->rounds;
  1153. X    c->station[0].info2 += m->rounds;
  1154. X
  1155. X    m->cinfo = lookupCraft ("m61a1 cannon");
  1156. X
  1157. X    return 0;
  1158. X
  1159. X}
  1160. X
  1161. Xextern craftType * newCraft ();
  1162. X
  1163. Xint    placeCannon(c, m, poly, cnt)
  1164. Xcraft    *c;
  1165. XVMatrix    *m;
  1166. XVPolygon **poly;
  1167. Xint    *cnt; {
  1168. X
  1169. X    double    t, intervalT;
  1170. X    VPoint    v, s;
  1171. X    int    i, j, k, n;
  1172. X    VPoint     *q, tmp;
  1173. X    VPolygon **p;
  1174. X
  1175. X/*
  1176. X *  Reduce the shell path to a set of parametric equations.
  1177. X */
  1178. X
  1179. X    v.x = c->Sg.x - c->prevSg.x;
  1180. X    v.y = c->Sg.y - c->prevSg.y;
  1181. X    v.z = c->Sg.z - c->prevSg.z;
  1182. X
  1183. X/*
  1184. X *  Now add each tracer shell to the view.
  1185. X */
  1186. X
  1187. X    intervalT = 1.0 / c->rounds;
  1188. X    for (t=intervalT*c->tracerVal; t <= 1.0; t += intervalT * TRACER_MOD) {
  1189. X        s.x = -v.x * t;
  1190. X        s.y = -v.y * t;
  1191. X        s.z = -v.z * t;
  1192. X        if (c->Sg.z + s.z > 0.0)    /* underground? don't plot it */
  1193. X            continue;
  1194. X        n = c->cinfo->object->numPolys;
  1195. X        p = c->cinfo->object->polygon;
  1196. X        j = *cnt;
  1197. X        for (i=0; i<n; ++i) {
  1198. X            poly[j] = VCopyPolygon(p[i]);
  1199. X            for ((k=0, q=poly[j]->vertex); k<poly[j]->numVtces; (++k, ++q)) {
  1200. X                VTransform(q, m, &tmp);
  1201. X                tmp.x += s.x;
  1202. X                tmp.y += s.y;
  1203. X                tmp.z += s.z;
  1204. X                *q = tmp;
  1205. X            }
  1206. X            ++j;
  1207. X        }
  1208. X        *cnt = j;
  1209. X    }
  1210. X
  1211. X    return(0);
  1212. X}
  1213. X
  1214. Xvoid initm61a1()
  1215. X{
  1216. X
  1217. X    craftType    *c;
  1218. X    FILE        *f;
  1219. X
  1220. X    wtbl[1] = m61a1Desc;
  1221. X
  1222. X    c = newCraft();
  1223. X    c->name = strdup("m61a1 cannon");
  1224. X
  1225. X    c->placeProc = placeCannon;
  1226. X
  1227. X    f = acm_fopen ("bullet", "r");
  1228. X    c->object = VReadObject(f);
  1229. X    fclose (f);
  1230. X
  1231. X}
  1232. X
  1233. Xint cannonCalculations (c)
  1234. Xcraft *c; {
  1235. X
  1236. X
  1237. X/*
  1238. X *  Kill projectile streams after 10.0 seconds of flight or when
  1239. X *  they strike the ground.
  1240. X */
  1241. X
  1242. X    if (curTime - c->createTime > 10.0)
  1243. X        return 1;
  1244. X
  1245. X    if (c->Sg.z > 0.0)
  1246. X        return 1;
  1247. X
  1248. X    c->prevSg = c->Sg;
  1249. X
  1250. X    c->Sg.x += c->Cg.x * deltaT;
  1251. X    c->Sg.y += c->Cg.y * deltaT;
  1252. X    c->Sg.z += c->Cg.z * deltaT + a * halfDeltaTSquared;
  1253. X
  1254. X    c->Cg.z += a * deltaT;
  1255. X    return 0;
  1256. X
  1257. X}
  1258. X
  1259. X/*
  1260. X *  plotReticle :  draws the aiming reticle onto the HUD.
  1261. X *
  1262. X *  An aiming reticle is a circle with an inner arc that clues the
  1263. X *  pilot as to the range of the target.  Twelve tic marks are used
  1264. X *  to demarcate the range -- each tic represents 1000 feet of
  1265. X *  distance.
  1266. X */
  1267. X
  1268. Xstatic struct {
  1269. X    double    x, y;
  1270. X    } ticTable[12] = {
  1271. X { 0.0, -1.0 },
  1272. X { 0.5, -0.866 },
  1273. X { 0.866, -0.5 },
  1274. X { 1.0, 0.0 },
  1275. X { 0.866, 0.5 },
  1276. X { 0.5, 0.866 },
  1277. X { 0.0, 1.0 },
  1278. X { -0.5, 0.866 },
  1279. X { -0.866, 0.5 },
  1280. X { -1.0, 0.0 },
  1281. X { -0.866, -0.5 },
  1282. X { -0.5, -0.866 } };
  1283. X
  1284. Xvoid plotReticle (c, u, x, y, range)
  1285. Xcraft    *c;
  1286. Xviewer    *u;
  1287. Xint    x;
  1288. Xint    y;
  1289. Xint    range; {
  1290. X
  1291. X#define RETICLE_SIZE    65
  1292. X#define RANGE_SIZE    59
  1293. X#define TICK_SIZE    (RETICLE_SIZE + 12)
  1294. X
  1295. X    register int    i, size, xt, yt, size1, xt1, yt1, nseg, arc;
  1296. X    XSegment    seg[16];
  1297. X    register double rs, rt;
  1298. X    Drawable    d;
  1299. X
  1300. X    d = (u->v->flags & VPMono) ? (Drawable) u->v->monoPixmap :
  1301. X        (Drawable) u->win;
  1302. X
  1303. X    size = RETICLE_SIZE * u->scaleFactor + 0.5;
  1304. X    if ((size & 1) == 0)
  1305. X        ++size;        /* insure it is an odd value */
  1306. X    xt = x - size / 2;
  1307. X    yt = y - size / 2;
  1308. X    rs = size / 2;
  1309. X    rt = ((TICK_SIZE + 1) / 2) * u->scaleFactor;
  1310. X
  1311. X    for (i=0; i < 12; i++) {
  1312. X        seg[i].x1 = x +
  1313. X            (int) (rs * ticTable[i].x + 0.5);
  1314. X        seg[i].y1 = y +
  1315. X            (int) (rs * ticTable[i].y + 0.5);
  1316. X        seg[i].x2 = x +
  1317. X            (int) (rt * ticTable[i].x + 0.5);
  1318. X        seg[i].y2 = y +
  1319. X            (int) (rt * ticTable[i].y + 0.5);
  1320. X    }
  1321. X
  1322. X    nseg = 12;
  1323. X    XDrawArc (u->dpy, d, u->gc, xt, yt, size, size, 0,
  1324. X        360 * 64);
  1325. X
  1326. X    if (range != -1) {
  1327. X        if (range > 12000)
  1328. X            range = 12000;
  1329. X        arc = - range * 23040 / 12000;
  1330. X        size1 = RANGE_SIZE * u->scaleFactor + 0.5;
  1331. X        if ((size1 & 1) == 0)
  1332. X            ++ size1;
  1333. X        if (size == size1)
  1334. X            -- size1;
  1335. X        xt1 = x - size1 / 2;
  1336. X        yt1 = y - size1 / 2;
  1337. X        XDrawArc (u->dpy, d, u->gc, xt1, yt1, size1, size1,
  1338. X            90 * 64, arc);
  1339. X    }
  1340. X
  1341. X    XDrawSegments (u->dpy, d, u->gc, seg, nseg);
  1342. X
  1343. X}
  1344. X
  1345. Xvoid lcos (c, u)
  1346. Xcraft *c;
  1347. Xviewer    *u; {
  1348. X
  1349. X
  1350. X/*
  1351. X *  How does this LCOS thing work, anyway?
  1352. X *
  1353. X *  First, let me say that this may or, more probably, may not look
  1354. X *  anything like the technique used in a real fighter's gun sighting
  1355. X *  system.  Having said that, here's the basic assumptions and steps
  1356. X *  used to generate the reticle on the HUD:
  1357. X *
  1358. X *  1)  Using radar, we know the distance to the target.  Assuming that the
  1359. X *    radar is in working order and is locked onto something.
  1360. X *
  1361. X *  2)  We know the muzzle velocity of the shells we're firing and can
  1362. X *    use that value to closely estimate the flight time of the shells
  1363. X *    to a target that's a certain distance away (the target).  Call
  1364. X *    this value "fTime".
  1365. X *
  1366. X *  3)    Use the muzzle velocity vector to determine the
  1367. X *    relative position (w.r.t. out craft) of a shell "fTime" seconds into
  1368. X *    its flight.  Call this vector "pos".
  1369. X *
  1370. X *  4)    Gravity will accelerate the shells. Use d = 0.5 * g * t ^ 2
  1371. X *    to add a distance (along the Z axis that will approximate the
  1372. X *    effect of gravity.  Add that to "pos".
  1373. X *
  1374. X *  5)    We know our pitch and yaw rates.  These rotations will have the
  1375. X *    effect of visually "bending" the cannon stream, from the pilot's
  1376. X *    perspective.  Use the values to generate a matrix to transform
  1377. X *    "pos" by an amount proportional to our "fTime" value.
  1378. X *
  1379. X *  6)    Convert our "pos" vector to screen x,y coordinates and call
  1380. X *    plotReticle.
  1381. X */
  1382. X
  1383. X    double    fTime, range, gm, pitch_rate, yaw_rate;
  1384. X    VPoint    pos, tmp, tmp1;
  1385. X    VPoint    zg, z;
  1386. X    VMatrix    rotation;
  1387. X    register int x, y, clue;
  1388. X    hist_t    *hist;
  1389. X
  1390. X    hist = &history[c->index];
  1391. X
  1392. X/*  Step 1  */
  1393. X
  1394. X    if (c->curRadarTarget >= 0)
  1395. X        range = c->targetDistance;
  1396. X    else
  1397. X        range = 2500.0;
  1398. X
  1399. X/*  Step 2  */
  1400. X
  1401. X    fTime = range / MUZZLE_VELOCITY;
  1402. X
  1403. X/*  Step 3  */
  1404. X
  1405. X    pos.x = fTime * MUZZLE_VELOCITY * cos (OFFSET_ANGLE);
  1406. X    pos.y = 0.0;
  1407. X    pos.z = - fTime * MUZZLE_VELOCITY * sin (OFFSET_ANGLE);
  1408. X
  1409. X/*  Step 4  */
  1410. X
  1411. X    zg.x = zg.y = 0.0;
  1412. X    zg.z = 1.0;
  1413. X
  1414. X    VTransform (&zg, &(c->Itrihedral), &z);
  1415. X
  1416. X    gm = 0.5 * a * fTime * fTime;
  1417. X    pos.x += z.x * gm;
  1418. X    pos.y += z.y * gm;
  1419. X    pos.z += z.z * gm;
  1420. X
  1421. X/*  Step 5  */
  1422. X
  1423. X    VIdentMatrix (&rotation);
  1424. X
  1425. X    pitch_rate = hist->pitch_total / (double) hist->count;
  1426. X    yaw_rate = hist->yaw_total / (double) hist->count;
  1427. X
  1428. X    if (pitch_rate != 0.0)
  1429. X        VRotate (&rotation, YRotation, pitch_rate * fTime);
  1430. X    if (yaw_rate != 0.0)
  1431. X        VRotate (&rotation, ZRotation, yaw_rate * fTime);
  1432. X
  1433. X    VTransform (&pos, &rotation, &tmp);
  1434. X
  1435. X/*  Step 6  */
  1436. X
  1437. X    tmp1 = tmp;
  1438. X    x = u->v->Middl.x + tmp1.y * u->v->Scale.x / tmp1.x + 0.5;
  1439. X    y = u->v->Middl.y + tmp1.z * u->v->Scale.y / tmp1.x + 0.5;
  1440. X
  1441. X    if (c->curRadarTarget >= 0)
  1442. X        clue = c->targetDistance + 0.5;
  1443. X    else
  1444. X        clue = -1;
  1445. X
  1446. X    plotReticle (c, u, x, y, clue);
  1447. X}
  1448. X
  1449. X/*
  1450. X *  lookForCannonImpacts : Track cannon shells and look for impacts with
  1451. X *               aircraft.  This algorithm tracks each shell's
  1452. X *               flight.
  1453. X */
  1454. X
  1455. Xtypedef struct _entry {
  1456. X    double    time;
  1457. X    double    min;
  1458. X    craft    *c;
  1459. X    struct    _entry *next;
  1460. X    }    entry;
  1461. X
  1462. X
  1463. Xextern int cdebug;
  1464. X
  1465. Xvoid    lookForCannonImpacts (m)
  1466. Xcraft    *m; {
  1467. X
  1468. X    craft    *c;
  1469. X    entry    p[MAXPLAYERS], *list, *q, *r, *rprev;
  1470. X    VPoint    v, s0, prevSg, Vm;
  1471. X    double    t, d, roundT, intervalT;
  1472. X    int    j;
  1473. X
  1474. X    intervalT = 1.0 / m->rounds;
  1475. X    for (roundT=0.0; roundT < 1.0; roundT += intervalT) {
  1476. X
  1477. X        Vm.x = m->Sg.x - m->prevSg.x;
  1478. X        Vm.y = m->Sg.y - m->prevSg.y;
  1479. X        Vm.z = m->Sg.z - m->prevSg.z;
  1480. X
  1481. X        prevSg.x = m->prevSg.x - Vm.x * (1.0 - roundT);
  1482. X        prevSg.y = m->prevSg.y - Vm.y * (1.0 - roundT);
  1483. X        prevSg.z = m->prevSg.z - Vm.z * (1.0 - roundT);
  1484. X
  1485. X        list = (entry *) NULL;
  1486. X        for (c=ptbl, j=0; j<MAXPLAYERS; ++j, ++c) {
  1487. X
  1488. X        if (c->type == CT_FREE || m->owner == c->index)
  1489. X            continue;
  1490. X
  1491. X/*
  1492. X * Reduce the relative motion of this object to a the parametric system
  1493. X * of equations:
  1494. X *        x(t) = vx * t + s0x
  1495. X *        y(t) = vy * t + s0y
  1496. X *        z(t) = vz * t + s0z
  1497. X *
  1498. X * We can then compute the time of perigee (closest pass) along with
  1499. X * the associated minimum distance.
  1500. X */
  1501. X
  1502. X            v.x = c->Sg.x - c->prevSg.x - Vm.x;
  1503. X            v.y = c->Sg.y - c->prevSg.y - Vm.y;
  1504. X            v.z = c->Sg.z - c->prevSg.z - Vm.z;
  1505. X            s0.x = c->prevSg.x - prevSg.x;
  1506. X            s0.y = c->prevSg.y - prevSg.y;
  1507. X            s0.z = c->prevSg.z - prevSg.z;
  1508. X
  1509. X/*
  1510. X * Compute time of minimum distance between the two objects (note that units
  1511. X * here are UPDATE_INTERVAL seconds).
  1512. X */
  1513. X
  1514. X            t = - (v.x * s0.x + v.y * s0.y + v.z * s0.z) /
  1515. X                (v.x * v.x + v.y * v.y + v.z * v.z);
  1516. X
  1517. X            if (cdebug)
  1518. X            printf ("perigee in %g seconds with player %d\n",
  1519. X                t*deltaT, j);
  1520. X
  1521. X/*
  1522. X *  If the closest pass occurs during this update interval, check for a hit.
  1523. X *  We'll build a linked list of all craft that this projectile may strike
  1524. X *  during this period, arranged in ascending order by time of "perigee"
  1525. X *  (closest pass).  We'll then test for strikes.  If a projectile misses
  1526. X *  the first object, then it may have struck subsequent objects in the
  1527. X *  list ...
  1528. X */
  1529. X
  1530. X/*
  1531. X *  One special case occurs when a target or missile's turn suddenly
  1532. X *  changes the perigee time from positive to negative.  If the missile
  1533. X *  is within hitting range at t=0 and the time of perigee is negative,
  1534. X *  then zap 'em.
  1535. X */
  1536. X
  1537. X            if (t < 0.0) {
  1538. X                d = sqrt (s0.x *s0.x + s0.y * s0.y +
  1539. X                    s0.z * s0.z);
  1540. X                if (isCannonHit (d, c)) {
  1541. X                    printf ("detected a \"curve hit\"\n");
  1542. X                    t = 0.0;
  1543. X                }
  1544. X            }
  1545. X
  1546. X            if (t >= 0.0 && t <= 1.0) {
  1547. X                q = &p[j];
  1548. X                if (list == (entry *) NULL) {
  1549. X                    q->next = list;
  1550. X                    list = q;
  1551. X                }
  1552. X                else if (list->time > t) {
  1553. X                    q->next = list;
  1554. X                    list = q;
  1555. X                }
  1556. X                else {
  1557. X                    for (rprev=list, r=list->next; r != (entry *) NULL;) {
  1558. X                        if (r->time > t) break;
  1559. X                        rprev = r;
  1560. X                        r = r->next;
  1561. X                    }
  1562. X                    if (rprev != list) 
  1563. X                        rprev->next = q;
  1564. X                    q->next = r;
  1565. X                }
  1566. X                q->time = t;
  1567. X                q->c = c;
  1568. X                q->min = sqrt (pow(v.x * t + s0.x, 2.0) +
  1569. X                    pow (v.y * t + s0.y, 2.0) +
  1570. X                    pow (v.z * t + s0.z, 2.0) );
  1571. X                    if (cdebug)
  1572. X                    printf ("perigee %g feet; craft %d.\n",
  1573. X                        q->min, j);
  1574. X            }
  1575. X        }
  1576. X
  1577. X/*
  1578. X *  Now look for cannon hits in the list of perigees.
  1579. X */
  1580. X
  1581. X        for (r=list; r != (entry *) NULL; r=r->next)
  1582. X            if (isCannonHit (r->min, r->c)) {
  1583. X    /*            killMissile (m); */
  1584. X                if (absorbDamage (r->c, 3) == 0)
  1585. X                    killPlayer (r->c);
  1586. X                break;
  1587. X            }
  1588. X    }
  1589. X}
  1590. X
  1591. X/*ARGSUSED*/
  1592. Xint isCannonHit (min, c)
  1593. Xdouble min;
  1594. Xcraft    *c; {
  1595. X
  1596. X    return (min < 50.0) ? 1 : 0;
  1597. X}
  1598. END_OF_FILE
  1599. if test 14922 -ne `wc -c <'acm/fsim/m61a1.c'`; then
  1600.     echo shar: \"'acm/fsim/m61a1.c'\" unpacked with wrong size!
  1601. fi
  1602. # end of 'acm/fsim/m61a1.c'
  1603. fi
  1604. echo shar: End of archive 7 \(of 9\).
  1605. cp /dev/null ark7isdone
  1606. MISSING=""
  1607. for I in 1 2 3 4 5 6 7 8 9 ; do
  1608.     if test ! -f ark${I}isdone ; then
  1609.     MISSING="${MISSING} ${I}"
  1610.     fi
  1611. done
  1612. if test "${MISSING}" = "" ; then
  1613.     echo You have unpacked all 9 archives.
  1614.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1615. else
  1616.     echo You still need to unpack the following archives:
  1617.     echo "        " ${MISSING}
  1618. fi
  1619. ##  End of shell archive.
  1620. exit 0
  1621. -- 
  1622. Riley Rainey            Internet: riley@mips.com
  1623. MIPS Computer Systems        Phone:    +1 214 770-7979
  1624. Dallas, Texas
  1625.